package com.ruoyi.report.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * Inventory Report 数据表，存储 Walmart 平台上的商品库存信息
 * @TableName walmart_inventory_report
 */
@TableName(value ="walmart_inventory_report")
@Data
public class WalmartInventoryReport implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)  // 设置主键和主键策略
    private Long id;
    /**
     * 商品的 SKU（库存单位）
     */
    @TableField(value = "sku")
    private String sku;

    /**
     * 商品在 Walmart 平台上的唯一标识符
     */
    @TableField(value = "item_id")
    private String itemId;

    /**
     * 商品名称
     */
    @TableField(value = "product_name")
    private String productName;

    /**
     * 发货节点的唯一标识符
     */
    @TableField(value = "ship_node_id")
    private Long shipNodeId;

    /**
     * 发货节点名称
     */
    @TableField(value = "ship_node_name")
    private String shipNodeName;

    /**
     * 输入的商品数量
     */
    @TableField(value = "input_quantity")
    private Integer inputQuantity;

    /**
     * 可销售的商品数量
     */
    @TableField(value = "avail_to_sell_quantity")
    private Integer availToSellQuantity;

    /**
     * 唯一请求id
     */
    @TableField(value = "request_id")
    private String requestId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WalmartInventoryReport other = (WalmartInventoryReport) that;
        return (this.getSku() == null ? other.getSku() == null : this.getSku().equals(other.getSku()))
            && (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getShipNodeId() == null ? other.getShipNodeId() == null : this.getShipNodeId().equals(other.getShipNodeId()))
            && (this.getShipNodeName() == null ? other.getShipNodeName() == null : this.getShipNodeName().equals(other.getShipNodeName()))
            && (this.getInputQuantity() == null ? other.getInputQuantity() == null : this.getInputQuantity().equals(other.getInputQuantity()))
            && (this.getAvailToSellQuantity() == null ? other.getAvailToSellQuantity() == null : this.getAvailToSellQuantity().equals(other.getAvailToSellQuantity()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSku() == null) ? 0 : getSku().hashCode());
        result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getShipNodeId() == null) ? 0 : getShipNodeId().hashCode());
        result = prime * result + ((getShipNodeName() == null) ? 0 : getShipNodeName().hashCode());
        result = prime * result + ((getInputQuantity() == null) ? 0 : getInputQuantity().hashCode());
        result = prime * result + ((getAvailToSellQuantity() == null) ? 0 : getAvailToSellQuantity().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", sku=").append(sku);
        sb.append(", itemId=").append(itemId);
        sb.append(", productName=").append(productName);
        sb.append(", shipNodeId=").append(shipNodeId);
        sb.append(", shipNodeName=").append(shipNodeName);
        sb.append(", inputQuantity=").append(inputQuantity);
        sb.append(", availToSellQuantity=").append(availToSellQuantity);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}